<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>welcome</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="__TPLPATH__/Public/beg/plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="__TPLPATH__/Public/beg/css/global.css" media="all">
    <link rel="stylesheet" href="__TPLPATH__/Public/beg/plugins/font-awesome/css/font-awesome.min.css">

  </head>
<blockquote class="layui-elem-quote">
  <a>配置微信公众平台的参数,用于接入后台管理</a>
</blockquote>
              
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  <legend>微信公众号参数</legend>
</fieldset>
 
<form class="layui-form" method="post">
  <div class="layui-form-item layui-form-pane">
    <label class="layui-form-label">token</label>
    <div class="layui-input-block">
      <input type="text" name="token" lay-verify="token" autocomplete="off" placeholder="请输入token" class="layui-input" value="{$config[0]['token']}">
    </div>
  </div>
  <div class="layui-form-item layui-form-pane">
    <label class="layui-form-label">APPID</label>
    <div class="layui-input-block">
      <input type="text" name="appid" lay-verify="appid" placeholder="请输入APPID" autocomplete="off" class="layui-input" value="{$config[0]['appid']}">
    </div>
  </div>
  <div class="layui-form-item layui-form-pane">
    <label class="layui-form-label">APPSECRET</label>
    <div class="layui-input-block">
      <input type="tel" name="appsecret" lay-verify="appsecret" autocomplete="off" class="layui-input" value="{$config[0]['appsecret']}">
    </div>
  </div>
  <div class="layui-form-item layui-form-pane">
    <label class="layui-form-label">encodingaeskey</label>
    <div class="layui-input-block">
      <input type="text" name="encoding" lay-verify="encoding" autocomplete="off" class="layui-input" value="{$config[0]['encoding']}">
    </div>
  </div>
  <div class="layui-form-item layui-form-pane">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit="" lay-filter="submit_wx_config">立即提交</button>
      
    </div>
  </div>
</form>
<script type="text/javascript" src="__TPLPATH__/Public/beg/plugins/layui/layui.js"></script>
</body>
</html>       
<script>
layui.use(['form'], function(){
  var form = layui.form()
  ,layer = layui.layer;
  //自定义验证规则
  form.verify({
    
  });
  
  
  
  //监听提交
  form.on('submit(submit_wx_config)', function(data){
    
    layer.confirm(JSON.stringify(data.field), {
      title: '最终的提交信息为',
      btn:['确认提交','取消提交'],
      yes:function(){layer.msg("提交成功");return true;},
      cancel:function(){layer.msg("取消提交");return true;}
    })
    //return false;
  });
  
  
});
</script>